<?php
  include("conn.php");

  $openid = $_POST['openid'];
  $name = $_POST['name'];
  $phone = $_POST['phone'];
  $college = $_POST['college'];
  $region = $_POST['region'];
  $education = $_POST['education'];

  $sql = "UPDATE `ut_user` SET `name`='$name', `phone`='$phone', `college`='$college', `region`='$region', `education`='$education' WHERE `openid`='$openid' ";
  $query = $conn->query($sql);
  $sql = "SELECT * FROM `ut_user` WHERE `openid` = '$openid'";
  $query = $conn->query($sql);
  if ($row = mysqli_fetch_assoc($query)) {
    print_r(json_encode($row));
  } else {
    print_r(json_encode(null));
  }
  $query->free_result();
  $conn->close();
?>